package com.kecheng.dto;

import java.io.Serializable;

public class WebCommonsResponse implements Serializable {
    private static final long serialVersionUID = 1l;

    private int code;
    private String info;
    private Object data;

    public static  WebCommonsResponse ok(){
        return new WebCommonsResponse(0,"成功",null);
    }
    public static  WebCommonsResponse ok(Object data){
        return new WebCommonsResponse(0,"成功",data);
    }
    public static  WebCommonsResponse error(){
        return new WebCommonsResponse(-1,"失败",null);
    }
    public static  WebCommonsResponse error(String info){
        return new WebCommonsResponse(-1,info,null);
    }

    public WebCommonsResponse(int code, String info, Object data) {
        this.code = code;
        this.info = info;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
